<template>
  <div class="not-found">
    <el-card class="card">
      <h1 class="title">404</h1>
      <p class="message">抱歉，您访问的页面不存在。</p>
      <el-button type="primary" @click="goHome">返回首页</el-button>
    </el-card>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router';

const router = useRouter();

const goHome = () => {
  router.push({ path: '/' }); // 假设首页的路由名称为 'Home'
};
</script>

<style scoped>
.not-found {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #f5f5f5;
}

.card {
  text-align: center;
  padding: 20px;
}

.title {
  font-size: 64px;
  margin-bottom: 16px;
}

.message {
  font-size: 18px;
  margin-bottom: 24px;
}
</style>
